/**
 * Copyright (C), 2020-2020, 人生无限公司
 * FileName: Test3
 * Description:
 * * 模拟在一副牌中，抽取第1张，第5张，第50张扑克牌。
 * 代码实现，效果所示：黑桃A 黑桃5 方片j
 * @create: 2020/7/14 20:18
 * @author Reanon
 * @version JDK1.8
 */
package homework;

public class Test3 {
    public static void main(String[] args) {
        String[] puke = initPukes();
        // 抽取指定的三种扑克牌
        int[] nums = new int[]{1, 5, 50};
        selectCard(nums, puke);

    }

    public static String[] initPukes() {
        // 获取所有扑克牌
        String[] arr1 = new String[]{"黑桃", "红桃", "梅花", "方片"};
        String[] arr2 = new String[]{"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "j", "Q", "K"};
        String[] puke = new String[100];
        int index = 0;
        for (int i = 0; i < arr1.length; i++) {
            for (int j = 0; j < arr2.length; j++) {
                puke[index] = arr1[i] + arr2[j];
                index++;
            }
        }
        puke[52] = "小王";
        puke[53] = "大王";
        return puke;
    }

    public static void selectCard(int[] chars, String[] cards) {
        for (int i = 0; i < chars.length; i++) {
            System.out.printf(cards[chars[i] - 1] + " ");
        }

    }
}
